﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp9
{
    class Program
    {
        static void Main(string[] args)
        {

            ArrayList list1 = new ArrayList() { "挺好", "ngh", 572 };
            int index = list1.IndexOf("aaa");

            if (index != -1)
            {
                Console.WriteLine("有");
            }
            else
            {
                Console.WriteLine("无");
            }
            Console.WriteLine();


            ArrayList list2 = new ArrayList() { 1, 2, 3, 4, 5, };
            ArrayList list3 = new ArrayList();
            for (int i = 0; i < list2.Count; i = i + 2)
            {
                list3.Add(list2[i]);
            }
            foreach (var a in list3)
            {
                Console.WriteLine(a);
            }
            Console.WriteLine();


            ArrayList list4 = new ArrayList() { "挺好", "ngh", 572 };
            ArrayList newList = new ArrayList() { "韩国人", "vbf", 468 };
            newList.InsertRange(1, list4);
            foreach (var b in newList)
            {
                Console.WriteLine(b);
            }
            Console.WriteLine();


            ArrayList list5 = new ArrayList() { "挺好", "ngh", 572 };
            list5.Sort();
            foreach (var c in list5)
            {
                Console.WriteLine(c);
            }
            Console.WriteLine();


            MyCompare MyCompare = new MyCompare();
            list5.Sort(MyCompare);
            foreach (var item in list5)
            {
                Console.Write(item + " ");
            }

        }
    }
}
